<%@page contentType="text/html; charset=UTF-8" session="false" %>
<%@include  file="/WEB-INF/jspf/import.jspf"%>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" id="pagerForm" name="searchForm" method="get">
        <input type="hidden" name="pageNum" value="${pager.pageNo}" />
        <input type="hidden" name="numPerPage" value="100" />
        <input type="hidden" name="pageSize" value="${pager.pageSize}" />
        <div class="searchBar">
            <table class="searchContent">
                <tbody>
                    <tr>
                        <td><label>车友会名称：</label><input type="text" name="name" value="${name}" class="textInput"></td>
                        <td><label>申请时间：</label>
                            <input type="text" value="${beginDate}" datefmt="yyyy-MM-dd 00:00:00" name="beginDate" class="date" readonly="true">
                            	至
                            <input type="text" value="${endDate}" datefmt="yyyy-MM-dd 23:59:59" name="endDate" class="date" readonly="true">
                        </td>
                    </tr>

                </tbody>
            </table>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
                </ul>
            </div>
        </div>
    </form>
</div>

<div class="panelBar">
    <ul class="toolBar">
        <li><a class="icon" onclick="batchSyncPick();"><span>同步精华帖子（所有选择项）</span></a></li>
        <li><a class="icon" onclick="batchSyncPickAll();"><span>同步精华帖子（所有查询结果项）</span></a></li>
    </ul>
</div>
<div class="pageContent">
    <table class="table" style="width: 100%" layoutH="163">
        <thead>
            <tr>
                <th width="2%"><input type="checkbox" class="checkboxCtrl" group="ids"></th>
                <th width="5%">车友会ID</th>
                <th width="5%">车友会名称</th>
                <th width="5%">创建者</th>
                <th width="5%">创建时间</th>
                <th width="5%">状态</th>
               
            </tr>
        </thead>
        <tbody>
            <c:forEach var="e" items="${pager.resultList}">
                <tr>
                    <td><input type="checkbox" name="ids" value="${e.clubId}"/></td>
                    <td>${e.clubId}</td>
                    <td>${fn:escapeXml(e.name)}</td>
                    <td>${e.createBy}</td>
                    <td><fmt:formatDate value="${e.createAt}" pattern="yyyy-MM-dd"/></td>
                    <td>${statusDesc[e.status]}</td>
                    
                </tr>
            </c:forEach>
        </tbody>
    </table>

</div>
<div class="panelBar">
    <div class="pages">
        <span>共 ${pager.total} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${pager.total}" numPerPage="${pager.pageSize}" pageNumShown="10" currentPage="${pager.pageNo}"></div>
</div>
<script type="text/javascript">
//同步选择的会长精华帖子
function batchSyncPick() {
	alertMsg.confirm("是否进行论坛精华帖子同步到车友会！", {
		okCall: function(){
			 var ids_value =[];  
                $('input[name="ids"]:checked').each(function(){  
                    ids_value.push($(this).val());  
                }); 
            if( ids_value.length == 0) {
                alertMsg.info("没有选择项！");
                return;
            }
            $.ajax({
				url: "${ctx}/admin/dev/syncPickTopic4ClubAdmin.do?req_enc=utf-8&pickType=select",
				type: "POST",
				data: {
					ids:ids_value
				},
				dataType: "json"
			}).done(function(result) {
                navTabAjaxDone(result);
			}).fail(function(jqXHR) {
				alertMsg.error("服务器调用失败!");
			});
		}
	});
}

//同步所有查询出来的会长精华帖子
function batchSyncPickAll() {
	alertMsg.confirm("是否进行论坛精华帖子同步到车友会！", {
		okCall: function(){
            $.ajax({
				url: "${ctx}/admin/dev/syncPickTopic4ClubAdmin.do?req_enc=utf-8&pickType=all",
				type: "POST",
				data: {
					ids:ids_value
				},
				dataType: "json"
			}).done(function(result) {
                navTabAjaxDone(result);
			}).fail(function(jqXHR) {
				alertMsg.error("服务器调用失败!");
			});
		}
	});
}
</script>
